home *** CD-ROM | disk | FTP | other *** search
- Path: homer.louisville.edu!arwild01
- From: arwild01@homer.louisville.edu (Alan Wild)
- Newsgroups: comp.lang.c
- Subject: Help with pointer alignment
- Date: 7 Feb 1996 20:06:49 GMT
- Organization: University of Louisville, Louisville KY USA
- Message-ID: <4fb0op$8l8@hermes.louisville.edu>
- NNTP-Posting-Host: homer.louisville.edu
- X-Newsreader: TIN [version 1.2 PL2]
-
- I am having a small problem with pointer alignment in a library I am
- developing. lint reports:
-
- "queue.c", line 13: warning: possible pointer alignment problem, op CAST
-
- And the code is as follows:
-
- struct dataChain {
- ORD64 dataf;
- ORD64 be;
- int cycle;
- struct dataChain *next;
- };
-
- typedef struct dataChain queueentry;
-
- void Append ( queueentry new, queue *Q ) {
-
- queueentry *temp = (queueentry *)malloc( sizeof( queueentry ) );
-
- temp->dataf = new.dataf;
- temp->be= new.be;
- temp->cycle = new.cycle;
- temp->next = new.next;
-
- AppendData ( temp, Q );
- }
-
- The line in error is the malloc statement. What have I done
- wrong/dangerously? I would like to correct this if at all possible.
- This is the only pententially problematic warning in my code and I would
- like to avoid any problems. :)
-
- Note: I have checked through several books and the C FAQ, but I haven't
- seen anything. My co-workers also did not have a clue about this one.
-
- I am developing on anIBM rs6000 running AIX 3.2.5. I am using the
- native version of lint.
-
- Thanks you,
-
- -Alan Wild
-
-